<?php include './application/views/common/zhs_header.php';?>
<div class="newtitle-box">
  <div class="newtitle w">
    <span class="invlist_title">您现在的位置：<a href="index.html">首页</a>><a class="red" href="#">用户登录</a></span>
  </div>
  </div>
 <form id="my_form">
		<input type="hidden" name="act" value="set">
		<div class="login_box w">
    <div class="login_bd">
			<ul>
				<li>&nbsp;<dt><em class="sem"><?php echo isset($user['username']) ? $user['username'] : '';?></em>，您好！请设置新登录密码。</dt></li>
				<li>新密码：<dt> <input class="inptl_1" id="txt1" type="text" value="密码由数字+字母组,有效提升您的账户安全性" >
					<input class="inptl_1" name="pwd1" id="pwd1"  style="display:none" type="password" value="" maxlength="20"></dt></li>
				<li>重复密码：<dt><input class="inptl_1" id="txt2" type="text" value="确认密码" >
					<input class="inptl_1" name="pwd2" id="pwd2" type="password"  style="display:none" value="" maxlength="20"></dt></li>
				<li><dt><input  id="btnSubmit" style="cursor:pointer; margin:0;" class="little_button" type="button" value="确认提交" onclick="toSubmit();"></dt></li>
				<li><dt>还没有加入<?php echo CON_PLATFORMNAME;?>？<a href="/reg/index/index.html">免费注册</a></dt></li>
			</ul>
			</div>
			</div>
		</form>
    
 <script type="text/javascript">
<?php if($msg!=''){?>
$(function(){
	$('#dialog').dialog({
		modal:true,
		title:'系统提示',
		buttons:{"确定":function(){$(this).dialog("close");}},
		close: function() {
			location="/login";
		}
	}); 
	$("#msg").html("<?php echo $msg;?>");
});

<?php }?>
function toSubmit(){
	var options = {
		url : "",
		clearForm :true,
		resetForm :true,
		beforeSubmit:  checkForm,
		dataType: "json",
		type:"post",
		success : function(ret) {
			if(ret.msg==''){
				$('#dialog').dialog({
					modal:true,
					title:'系统提示',
					buttons:{"确定":function(){$(this).dialog("close");}},
					close: function() {
						location=ret.url;
					}
				}); 
				$("#msg").html("操作成功");
			}else{
				$('#dialog').dialog({
					modal:true,
					title:'系统提示',
					buttons:{"确定":function(){$(this).dialog("close");}}
				}); 
				$("#msg").html(ret.msg);
			}
		}
	};
	$("#my_form").ajaxSubmit(options);
	return false;
}

function checkForm(){
	var err = '';
	if($('#pwd1').val()==''){
		err = '请输入新密码';
	}else if($('#pwd2').val()==''){
		err = '请重复新密码';
	}else if($('#pwd1').val()!=$('#pwd2').val()){
		err = '两次密码输入不一致';
	}
	
	if(err==''){
		return true;
	}else{
		$('#dialog').dialog({
			modal:true, //蒙层（弹出会影响页面大小）
			title:'系统提示',
			buttons:{"确定":function(){$(this).dialog("close");}},
			close: function() {
				$("#my_form").resetForm();
			}
		}); 
		$("#msg").html(err);
		return false;
	}
}
</script>
</div> 
<?php include './application/views/common/zhs_footer.php';?>
<?php include './application/views/common/zhs_right.php';?>

